Current Location: Home> Function Categories> cos

cos

Cosine
Name:cos
Category:math
Programming Language:php
One-line Description:Cosine.

Definition and usage

cos() function returns the cosine of a number.

Example

In this case, we will calculate the cosines of different values:

 <?php
echo ( cos ( 3 ) ) ;
echo ( cos ( - 3 ) ) ;
echo ( cos ( 0 ) ) ;
echo ( cos ( M_PI ) ) ;
echo ( cos ( 2 * M_PI ) ) ;
?>

Try it yourself

grammar

 cos ( x )
parameter describe
x Required. A number.

illustrate

cos() returns the cosine value of the parameter x . The unit of parameter x is radians.

Similar Functions
  • Get the pi value pi

    pi

    Getthepivalue
  • Convert decimal to octal decoct

    decoct

    Convertdecimaltoocta
  • Sow the random number generator seeds srand

    srand

    Sowtherandomnumberge
  • Find the maximum value max

    max

    Findthemaximumvalue
  • Hyperbolic cosine cosh

    cosh

    Hyperboliccosine
  • Calculate the index of e exp

    exp

    Calculatetheindexofe
  • Combined linear congruent generator lcg_value

    lcg_value

    Combinedlinearcongru
  • Natural logarithm log

    log

    Naturallogarithm
Popular Articles